package main

import (
	"beetest/models"
	_ "beetest/routers"
	"github.com/astaxie/beego"
	"github.com/astaxie/beego/orm"
	_ "github.com/go-sql-driver/mysql"
)

func main() {
	if beego.BConfig.RunMode == "dev" {
		beego.BConfig.WebConfig.DirectoryIndex = true
		beego.BConfig.WebConfig.StaticDir["/swagger"] = "swagger"
	}
	orm.Debug = true
	orm.RegisterDriver("mysql", orm.DRMySQL)
	orm.RegisterDataBase("default", "mysql", "root:jiaojie529@tcp(192.168.1.70:3306)/beego?charset=utf8&loc=Asia%2FShanghai")
	orm.RegisterModel(new(models.Person))

	beego.Run()
}
